from django.db import models


# Create your models here.
class Class(models.Model):
    title = models.CharField(verbose_name='班级', max_length=32)


class Student(models.Model):
    name = models.CharField(verbose_name='姓名', max_length=32)
    mail = models.EmailField(max_length=32)
    age = models.IntegerField()
    cls = models.ForeignKey(to='Class', on_delete=models.CASCADE)


class Teacher(models.Model):
    name = models.CharField(verbose_name='姓名', max_length=32)
    c2t = models.ManyToManyField('Class')


class UserInfo(models.Model):
    name = models.CharField(verbose_name='姓名', max_length=32)
    position = models.CharField(verbose_name='职位', max_length=32)
    account = models.CharField(verbose_name='账户名', max_length=32)
    password = models.CharField(verbose_name='密码', max_length=32)
